feat(tools): added linear tools/block#439
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
PR Summary
Added Linear integration to enable reading and creating issues through the platform, with team and project selection capabilities and OAuth authentication support.
- Implemented GraphQL-based Linear API integration in
/apps/sim/tools/linear/with separate tools for reading and creating issues - Added Linear OAuth configuration in
lib/oauth.tsandlib/auth.tswith proper scopes and user info handling - Created UI components for team/project selection in
/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/project-selector/ - Added API routes for Linear teams and projects under
/apps/sim/app/api/tools/linear/ - Comprehensive documentation added in
/apps/docs/content/docs/tools/linear.mdxwith usage instructions and API specifications
20 files reviewed, 27 comments
Edit PR Review Bot Settings | Greptile
| issues: (data.data.issues.nodes as LinearIssue[]).map((issue) => ({ | ||
| id: issue.id, | ||
| title: issue.title, | ||
| description: issue.description, | ||
| state: issue.state, | ||
| teamId: issue.teamId, | ||
| projectId: issue.projectId, | ||
| })), |
There was a problem hiding this comment.
logic: Response mapping is incorrect - accessing issue.teamId and issue.projectId directly will be undefined since the GraphQL response nests these under team.id and project.id
| issues: (data.data.issues.nodes as LinearIssue[]).map((issue) => ({ | |
| id: issue.id, | |
| title: issue.title, | |
| description: issue.description, | |
| state: issue.state, | |
| teamId: issue.teamId, | |
| projectId: issue.projectId, | |
| })), | |
| issues: (data.data.issues.nodes as LinearIssue[]).map((issue) => ({ | |
| id: issue.id, | |
| title: issue.title, | |
| description: issue.description, | |
| state: issue.state, | |
| teamId: issue.team.id, | |
| projectId: issue.project.id, | |
| })), |
| interface LinearTeamSelectorProps { | ||
| value: string | ||
| onChange: (teamId: string, teamInfo?: LinearTeamInfo) => void | ||
| credential: string | ||
| label?: string | ||
| disabled?: boolean | ||
| showPreview?: boolean | ||
| } |
There was a problem hiding this comment.
style: showPreview prop is defined but never used in the component. Either implement the preview functionality or remove the unused prop.
| return { | ||
| success: false, | ||
| output: { issues: [] }, | ||
| error: data.errors.map((e: any) => e.message).join('; '), |
There was a problem hiding this comment.
style: Using any type for error mapping is unsafe. Consider defining proper error types from Linear API
| id: issue.id, | ||
| title: issue.title, | ||
| description: issue.description, | ||
| state: issue.state, |
There was a problem hiding this comment.
logic: state is passed through directly but the type expects a string - should be issue.state.name based on the query
| state: issue.state, | |
| state: issue.state.name, |
Description
Users can now read and write Linear issues when both a team and project are specified.
Fixes #104
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Tested by configuring the Linear integration, attempting to create and read issues, Verified that issue creation and retrieval work as expected when all required fields are provided.
Checklist:
bun run test)Security Considerations: